<template>
    <table class="table table-striped table-bordered table-hover mt-O10">
        <thead>
            <tr>
                <th width="30">#</th>
                <th>用户名</th>
                <th>年龄</th>
                <th>性别</th>
                <th>手机号</th>
                <th>爱好</th>
                <th>学历</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr :key="index" v-for="(user,index) in list">
                <td>{{index + 1}}</td>
                <td>{{user.userName}}</td>
                <td>{{user.age}}</td>
                <td>{{user.gender}}</td>
                <td>{{user.mobile}}</td>
                <td>{{user.hobbies}}</td>
                <td>{{user.edu}}</td>
                <td>
                    <button @click="updataUser(user)" class="btn btn-warning btn-xs">修改</button>
                    <button @click="delUser(user.id)" class="btn btn-danger btn-xs">删除</button>
                </td>
            </tr>
        </tbody>
    </table>
</template>

<script>
export default {
    props: ["list"],
    methods: {
        updataUser(thisUser) {
            this.$emit("dialog", {
                isOpen: true,
                isAdd: false
            },thisUser)
        },
        delUser(uId){
            this.$emit("del",uId)
        }
    }
}
</script>

<style>

</style>
